package com.tkmybatis.controller;

import com.tkmybatis.annotation.NoRequestSubmit;
import com.tkmybatis.hfy.base.entity.Result;
import com.tkmybatis.hfy.utils.HttpUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * Project_name: tk_mybatis_demo
 * Company: 新致软件
 * Author: ZHU YU WEI
 * Date: Created in 12:33 2021/4/7.
 * Description:
 * Modified By:
 */
@RestController
@RequestMapping("/auth")
public class LoginController {



    @RequestMapping("/login")
    @NoRequestSubmit
    public Result login(HttpServletRequest request, String uname, String mima){
        String remortIp = HttpUtil.getRemortIp(request);

        //根据用户名称查询账号对象
        Map<String,Object> hashmap=new HashMap<String,Object>();
        hashmap.put("uname",uname);
        hashmap.put("password",mima);
        hashmap.put("ip",remortIp);
        //登陆成功以后记录登陆日志
        return Result.sucess(hashmap);


    }


}
